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AAA,IAAF,oBACiBI,EAAAA,GAAAA,GADjB,QAGLC,MAAML,EAAAA,EAAAA,IAAF,oBACkBI,EAAAA,GAAAA,GADlB,QAGJE,MAAMN,EAAAA,EAAAA,IAAF,SACOI,EAAAA,GAAAA,GADP,qBAEkBA,EAAAA,GAAAA,GAFlB,UAOFG,EAAU,SAAC,GAA6C,IAA3CC,EAA2C,EAA3CA,QAASC,EAAkC,EAAlCA,SAAUX,EAAwB,EAAxBA,QAAY3B,GAAY,kBAC5D,OACE,2BAAS6B,IAAG,CAAGJ,EAAMC,QAAQC,GAAUF,EAAMM,MAAMM,GAAvC,QAAsDrC,GAC/DsC,IAWPF,EAAQG,aAAe,CACrBF,QAAS,QACTV,SAAS,GAGX,O,uBCzDKX,OAAOwB,SAAWxB,OAAOwB,UAAY,IAAIC,KAAK,CAC7C,4BACA,WACE,OAAO,EAAQ,Y","sources":["webpack://_N_E/./pages/statenet-redirect/[slug].js","webpack://_N_E/./src/shared/components/Section.js","webpack://_N_E/?1b51"],"sourcesContent":["import { useAuth0 } from '@auth0/auth0-react';\nimport { notification } from 'antd';\nimport Router from 'next/router';\nimport React, { useEffect } from 'react';\nimport { connect } from 'react-redux';\n\nimport Container from '@/src/shared/components/Container';\nimport Section from '@/src/shared/components/Section';\nimport request from '@/utils/axios';\n\nconst StatenetRedirect = props => {\n const { isLoggedIn, personId, emailaddress, type } = props;\n const { isLoading, isAuthenticated, loginWithRedirect } = useAuth0();\n\n const redirectMember = async (id, email) => {\n if (!id || !email) return;\n await request({\n url: '/lookup/statenetredirecturl',\n params: {\n personId: Number(id),\n email,\n type,\n },\n }).then(response => {\n const { data } = response;\n if (data) {\n window.location = data;\n }\n\n if (!data) {\n notification.error({\n message: 'Error',\n description: data.Message,\n });\n }\n });\n };\n\n useEffect(() => {\n if (isLoggedIn && type) {\n redirectMember(personId, emailaddress);\n }\n\n if (!isLoading && !isAuthenticated) {\n loginWithRedirect({\n appState: {\n returnTo: Router.pathname,\n },\n });\n }\n }, [type, personId, emailaddress, isLoading, isAuthenticated]);\n\n return (\n <>\n \n \n Redirecting to LexisNexis State Net...
\n \n \n >\n );\n};\n\nexport const getStaticProps = async ({ params }) => {\n return {\n props: {\n type: params.slug,\n },\n };\n};\n\nexport async function getStaticPaths() {\n return {\n paths: [{ params: { slug: 'maptrack' } }, { params: { slug: 'profile' } }],\n fallback: false,\n };\n}\n\nexport default connect(\n state => {\n const { auth } = state;\n const {\n isLoggedIn,\n userinfo: { PersonID, emailaddress },\n } = auth;\n return {\n isLoggedIn,\n personId: PersonID,\n emailaddress,\n };\n },\n null\n)(StatenetRedirect);\n","import { css, jsx } from '@emotion/react';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { bp, colors } from '@/styles';\n\nconst style = {\n section: halfPad => {\n const paddingValue = halfPad ? 20 : 40;\n return css`\n padding-top: ${paddingValue}px;\n padding-bottom: ${paddingValue}px;\n @media ${bp.md} {\n padding-top: ${paddingValue * 2}px;\n padding-bottom: ${paddingValue * 2}px;\n }\n @media print {\n padding-top: 28px !important;\n padding-bottom: 28px !important;\n }\n &:empty {\n padding: 0;\n }\n `;\n },\n theme: {\n white: css`\n background-color: ${colors.white};\n `,\n gray: css`\n background-color: ${colors.accentGrayUltralight};\n `,\n blue: css`\n color: ${colors.white};\n background-color: ${colors.secondaryBlue};\n `,\n },\n};\n\nconst Section = ({ bgColor, children, halfPad, ...props }) => {\n return (\n \n );\n};\n\nSection.propTypes = {\n bgColor: PropTypes.oneOf(['gray', 'white', 'blue']),\n children: PropTypes.node.isRequired,\n halfPad: PropTypes.bool,\n};\n\nSection.defaultProps = {\n bgColor: 'white',\n halfPad: false,\n};\n\nexport default Section;\n","\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/statenet-redirect/[slug]\",\n function () {\n return require(\"private-next-pages/statenet-redirect/[slug].js\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/statenet-redirect/[slug]\"])\n });\n }\n "],"names":["connect","state","auth","isLoggedIn","userinfo","personId","PersonID","emailaddress","props","type","useAuth0","isLoading","isAuthenticated","loginWithRedirect","redirectMember","id","email","request","url","params","Number","then","response","data","window","location","message","description","Message","useEffect","appState","returnTo","Router","style","section","halfPad","paddingValue","css","bp","theme","white","colors","gray","blue","Section","bgColor","children","defaultProps","__NEXT_P","push"],"sourceRoot":""}